//
//  KMViewStore.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 ZHBen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "KUIModule.h"
#import "KMView.h"
#import "KMViewConfig.h"

#define KAddModelView(name) \
+ (void)load {[KMConfigStore registerModelView:[self class]];} \
+ (NSString *)viewID {return name;}

#define KAddDecorationView(name) \
+ (void)load {[KMConfigStore registerDecorationView:[self class]];} \
+ (NSString *)viewID {return name;}

@interface KMConfigStore : NSObject

+ (void)registerModelView:(Class<KMView>)viewClass;

+ (void)registerDecorationView:(Class<KMDecorationView>)viewClass;

+ (KMViewConfig *)modelConfigForViewID:(NSString *)viewID;

+ (Class<KMDecorationView>)decorationForViewID:(NSString *)viewID;

+ (BOOL)configModel:(NSObject *)model module:(KUIModule *)module;

@end
